package com.nkdx.ws.exception;

import com.nkdx.ws.enums.CodeEnum;
import lombok.Data;

/**
 *
 *   自定义异常
 * @author ZZW
 * @date 2022/3/2 4:02 下午
 * @param
 * @return
 */

@Data
public class DataException extends RuntimeException {

    private Integer code;
    private String msg;

    public DataException(String message) {
        super(message);
    }

    public DataException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public DataException(CodeEnum codeEnum) {
        this.code = codeEnum.getCode();
        this.msg = codeEnum.getMsg();
    }
}
